'use strict';

const Controller = require('egg').Controller;

class DeptController extends Controller {
    /**
     * 获取用户列表
     */
    async list() {
        const { ctx } = this;
        let data = await ctx.service.dept.list(ctx.query);
        ctx.body = {
            code: 200,
            msg: "成功",
            data: data
        };
    }

    /**
     * 添加用户
     */
    async add() {
        const { ctx } = this;
        console.log("提交的数据",ctx.request.body);
        let query = { limit: 0, offset: 10 };
        // let data = await ctx.model.jws_user.findAll(query);
        ctx.body = {
            code: 200,
            msg: "成功",
            data: {},
        };
    }
}

module.exports = DeptController;